import { IsNumber, IsOptional, Min, IsEnum, IsString } from 'class-validator';
import { Transform } from 'class-transformer';
import { PlatformType, ProjectType } from '../entities/sourcemap.entity';

export class ListSourcemapDto {
  @IsOptional()
  @IsNumber()
  @Min(1)
  @Transform(({ value }) => parseInt(value, 10))
  page?: number = 1;

  @IsOptional()
  @IsNumber()
  @Min(1)
  @Transform(({ value }) => parseInt(value, 10))
  pageSize?: number = 10;

  @IsOptional()
  @IsEnum(PlatformType)
  platformType?: PlatformType;

  @IsOptional()
  @IsString()
  customerName?: string;

  @IsOptional()
  @IsEnum(ProjectType)
  projectType?: ProjectType;
}
